package com.financing.platform.dao.impl;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.financing.platform.dao.IFpBiddingReceiptDao;
import com.financing.platform.dto.FpBiddingReceiptDTO;
import com.financing.platform.dto.FpBiddingRevenueDTO;
import com.financing.platform.util.SqlName;
import com.financing.platform.vo.FpBiddingReceiptVO;



@Repository("fpBiddingReceiptDaoImpl")
public class FpBiddingReceiptDaoImpl extends BaseDaoImpl implements IFpBiddingReceiptDao {

	@Override
	public List<FpBiddingReceiptVO> queryFpBiddingReceipt(
			FpBiddingReceiptDTO dto) throws SQLException {
		return this.sqlMapClient.queryForList(SqlName.queryFpBiddingReceipt,dto);
	}

	@Override
	public int queryFpBiddingReceiptCount(FpBiddingReceiptDTO dto)
			throws SQLException {
		return (Integer) this.sqlMapClient.queryForObject(SqlName.queryFpBiddingReceiptCount,dto);
	}

	@Override
	public Map<String,Object> queryFpBiddingReceiptDetail(FpBiddingReceiptDTO dto)
			throws SQLException {
		return (Map<String, Object>) this.sqlMapClient.queryForObject(SqlName.queryFpBiddingReceiptDetail,dto);
	}

	@Override
	public int updateBiddingReceipt(FpBiddingReceiptDTO dto)
			throws SQLException {
		return this.sqlMapClient.update(SqlName.updateBiddingReceipt,dto);
	}

	@Override
	public Map<String, Object> queryBiddingReceiptSuccess(
			FpBiddingReceiptDTO dto) throws SQLException {
		return (Map<String, Object>) this.sqlMapClient.queryForObject(SqlName.queryBiddingReceiptSuccess,dto);
	}

	@Override
	public List<Map<String, Object>> queryBiddingReceiptSuccessRebate(
			FpBiddingReceiptDTO dto) throws SQLException {
		return this.sqlMapClient.queryForList(SqlName.queryBiddingReceiptSuccessRebate,dto);
	}

	@Override
	public Integer addFpBiddingReceipt(FpBiddingReceiptDTO dto) throws SQLException {
		return (Integer) this.sqlMapClient.insert(SqlName.addFpBiddingReceipt,dto);
	}

	@Override
	public Integer addFpBiddingRevenue(FpBiddingRevenueDTO dto) throws SQLException {
		return (Integer) this.sqlMapClient.insert(SqlName.addFpBiddingRevenue,dto);
	}

	@Override
	public List<Map<String, Object>> queryFpBiddingRevenueList(int receiptId)
			throws SQLException {
		return this.sqlMapClient.queryForList(SqlName.queryFpBiddingRevenueList, receiptId);
	}

	@Override
	public List<Map<String, Object>> queryUnFreezingBailList(
			FpBiddingReceiptDTO dto) throws SQLException {
		return this.sqlMapClient.queryForList(SqlName.queryUnFreezingBailList,dto);
	}
	
	@Override
	public FpBiddingReceiptDTO queryBiddingReceipt(
			FpBiddingReceiptDTO dto) throws SQLException {
		return (FpBiddingReceiptDTO) this.sqlMapClient.queryForObject(SqlName.queryBiddingReceipt,dto);
	}
	
}
